//
//  ManufacturerCollectionViewCell.swift
//  ZNZXSuperMarket
//
//  Created by 四川中农 on 2018/7/26.
//  Copyright © 2018年 四川中农. All rights reserved.
//

import UIKit

class ManufacturerCollectionViewCell: UICollectionViewCell {
    
    @IBOutlet weak var img: UIImageView!
    @IBOutlet weak var nameLabel: UILabel!
    @IBOutlet weak var discountLabel: UILabel!
    @IBOutlet weak var bgView: UIView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        self.bgView.setCornerRadio(radio: 10, isMask: false)
        self.bgView.setShadow(color: "000000", offset: CGSize.init(width: 0, height: 1.5), radius: 3, opacity: 0.15)
        self.img.corner(byRoundingCorners: [.topRight,.topLeft], radii: 10)
    }
    
    func reload(withModel model:FireSiteModel){
        self.img.my_setImage(url:model.img, placeholder: Api.placeHolder.rawValue)
        self.nameLabel.text = model.name
        let attribateString = NSMutableAttributedString.init(string: "  "+model.content+"  ")
        attribateString.addAttributes([NSAttributedStringKey.font:UIFont.systemFont(ofSize: 14)], range: NSRange.init(location: 2, length: 1))
        self.discountLabel.attributedText = attribateString
    }
}
